﻿using MengLin.OOP.DesignPattern.Interface;
using MengLin.OOP.DesignPattern.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.SimpleFactoryAdvanced
{
    class Program
    {
        static void Main(string[] args)
        {
            User newUser = new User();
            newUser.Id = 123456;
            newUser.Name = "张三";

            #region 简单工厂的高级形态写法
            {
                IUserService iUserService = ObjFactory.CreateInstance();
                iUserService.CreateUser(newUser);
                iUserService.GetUser(1);
            }
            #endregion

            Console.Read();
        }
    }
}
